﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    class Strawberry : Fruit
    {
        private double pLowA, pLowB, pLowC, pJulMi, pJulSigma, pJulGamma, pHighMi, pHighSigma, pHighGamma;

        public Strawberry()
        {
            _life = 15;
            this.pLowA = 4.5694;
            this.pLowB = 6.5;
            this.pLowC = 11.747;
            this.pJulMi = 3.6745;
            this.pJulSigma = 0.02922;
            this.pJulGamma = -34.123;
            this.pHighMi = 1.8959;
            this.pHighSigma = 0.16949;
            this.pHighGamma = 5.7765;

            this._pLowMin = pLowA;
            this._pLowMax = pLowC;
            this._pHighMin = 10.5;
            this._pHighMax = 15;
            this._pJulMin = 3.2;
            this._pJulMax = 7.2;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Triangular.GetDistributionValue(pLowA, pLowB, pLowC);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pHighMin, _pHighMax, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pJulMin, _pJulMax, pJulMi, pJulSigma, pJulGamma);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Triangular.fTriangular(x, pLowA, pLowB, pLowC);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pJulMi, pJulSigma, pJulGamma);
        }

        public double PLowA
        {
            get { return pLowA; }
            set { pLowA = value; }
        }

        public double PLowB
        {
            get { return pLowB; }
            set { pLowB = value; }
        }

        public double PLowC
        {
            get { return pLowC; }
            set { pLowC = value; }
        }

        public double PJulMi
        {
            get { return pJulMi; }
            set { pJulMi = value; }
        }

        public double PJulSigma
        {
            get { return pJulSigma; }
            set { pJulSigma = value; }
        }

        public double PJulGamma
        {
            get { return pJulGamma; }
            set { pJulGamma = value; }
        }

        public double PHighMi
        {
            get { return pHighMi; }
            set { pHighMi = value; }
        }

        public double PHighSigma
        {
            get { return pHighSigma; }
            set { pHighSigma = value; }
        }

        public double PHighGamma
        {
            get { return pHighGamma; }
            set { pHighGamma = value; }
        }
    }
}
